package org.dylan.bdf.system.entity;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.dylan.common.entity.AbstractUUIDEntity;
import org.dylan.security.entity.IDept;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name = "SYS_DEPT")
public class Dept extends AbstractUUIDEntity implements IDept {
	private static final long serialVersionUID = 7098808442861516801L;
	private String name;
	private String remark;
	@ManyToOne
	@JoinColumn(name = "parent_id")
	private Dept parent;
	@JsonIgnore
	@OneToMany(mappedBy = "parent")
	private List<Dept> childList;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Dept getParent() {
		return parent;
	}

	public void setParent(Dept parent) {
		this.parent = parent;
	}

	public List<Dept> getChildList() {
		return childList;
	}

	public void setChildList(List<Dept> childList) {
		this.childList = childList;
	}

}
